﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json;
using BusinessClass.Business.Enumerations;

namespace BusinessClass.Business.ConfigEntity
{
    /// <summary>
    /// 文字生成图片配置实体
    /// </summary>
    public class DrawTextConfig : RuleConfig
    {
        //对旧有的做兼容
        [JsonProperty("width")]
        public string Width { get; set; }
        [JsonProperty("height")]
        public string Heigth { get; set; }
        [JsonProperty("fontsize")]
        public string FontSize { get; set; }
        [JsonProperty("bold")]
        public bool Bold { get; set; }
        [JsonProperty("color")]
        public string FrontColor { get; set; }
        [JsonProperty("backcolor")]
        public string BackColor { get; set; }
        [JsonProperty("oriOption")]
        public string Orientation { get; set; }
        [JsonProperty("hor")]
        public string HorPosition { get; set; }
        [JsonProperty("ver")]
        public string VerPosition { get; set; }

        public override string ToString()
        {
            return JsonConvert.SerializeObject(this);
        }
        public new static DrawTextConfig FromJson(String json)
        {
            return JsonConvert.DeserializeObject<DrawTextConfig>(json);
        }
    }
}
